package com.yy.mall.cart.vo;

import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author lzy
 * @date 2021/9/28 16:10
 * 购物项内容
 */
public class CartItem {
    /**
     * 商品id
     */
    @ApiModelProperty("商品id")
    private Long skuId;
    /**
     * 商品标题
     */
    @ApiModelProperty("商品标题")
    private String title;
    /**
     * 商品图片
     */
    @ApiModelProperty("商品图片")
    private String image;
    /**
     * 商品属性 颜色 内存
     */
    @ApiModelProperty("商品属性 颜色 内存")
    private List<String> skuAttr;
    /**
     * 商品价格
     */
    @ApiModelProperty("商品价格")
    private BigDecimal price;
    /**
     * 商品数量
     */
    @ApiModelProperty("商品数量")
    private Integer count;

    @ApiModelProperty("总价")
    private BigDecimal totalPrice;

    @ApiModelProperty("是否选择")
    private boolean check;

    public boolean isCheck() {
        return check;
    }

    public void setCheck(boolean check) {
        this.check = check;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSkuAttr() {
        return skuAttr;
    }

    public void setSkuAttr(List<String> skuAttr) {
        this.skuAttr = skuAttr;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    /**
     * 计算当前项总价
     * @return
     */
    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(""+this.count));
    }

//    public void setTotalPrice(BigDecimal totalPrice) {
//        this.totalPrice = totalPrice;
//    } TODO
}
